<!DOCTYPE html>
<html>
  <head>
    <title>任务详情</title>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="__STATIC__/mobile/css/weui.min.css">
	<link rel="stylesheet" href="__STATIC__/mobile/css/jquery-weui.css">
    <!-- <link rel="stylesheet" href="css/style.min.css"> -->
    <link rel="stylesheet" href="__STATIC__/mobile/css/demos.css">
    <link rel="stylesheet" href="__STATIC__/mobile/css/main.css">
    <link rel="stylesheet" href="__STATIC__/mobile/css/iconfont.css">
	  <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/0.3.0/weui.css" />
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DA6Bw0637vf4t96C4GRhyPBMyplqG6zA"></script>
	  <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <style>
    	.navbar {
		    height: 50px;
		    color: #000;
		    background: #ffd966;
		    position: fixed;
		    top: 0;
		    left: 0;
		    right: 0;
		    z-index: 99;
		    display: -webkit-box;
		    display: -ms-flexbox;
		    overflow: hidden;
		}
		.navbar .nav-wrap-left {
		    height: 100%;
		    width: 25%;
		    line-height: 50px;
		}
		.navbar .nav-wrap-left .nav-btn {
		    padding-right: 0;
		}
		.navbar .nav-btn {
		    padding: 0 0 0 10%;
		   	width: 90%;
		   	height: 100%;
		    display: block;
		    color: #000;
		    font-size: 14px;
		}
		a:active, a:focus, a:hover, a:visited {
		    color: #bbb;
		}
		a, a:hover, del, ins, s, u {
		    text-decoration: none;
		}
		.barbtn, a, button, em, input, textarea {
		    -webkit-tap-highlight-color: rgba(255,0,0,0);
		}
		a {
		    color: #666;
		    text-decoration: none;
		    outline: 0;
		}
		.navbar .nav-title {
			width: 50%;
		    height: 100%;
		    overflow: hidden;
		    line-height: 50px;
		    text-align: center;
		    -webkit-box-flex: 1;
		    -ms-flex: 1;
		}
		.navbar .nav-wrap-right {
		    height: 100%;
		    width: 25%;
		    line-height: 50px;
		    text-align: right;
		}
		.filterbar .dropdown-toggle.active {
		    color: #179b16;
		}
		.icon-xuanzechengshi {
			font-size: 8px!important;
		}
		#joblist .list-item .salary span, #loadMore .list-item .salary span, #recommend-job .list-item .salary span {
		    color: #179b16;
		    font-size: .42rem;
		}
		.pic {
			width: 55px!important;
		}
		.pic img{
			width: 55px!important;
			height: 55px;
		}
		.filterbar .dropdown-wrapper {
		    position: absolute;
		    width: 100%;
		    z-index: inherit;
		}
		.filterbar .nav {
		    position: relative;
    		z-index: inherit;
		}
		.block {
			display: block;
		}
		.none {
			display: none;
		}
		.filterbar .nav {
		    display: -webkit-box;
		    display: -ms-flexbox;
		    background: #fff;
		    border-bottom: 1px solid #e5e5e5;
		    text-align: center;
		    height: .86rem;
		    line-height: .86rem;
		    -webkit-user-select: none;
		    font-size: 13px;
		    text-align: center;
		}
		.main {
			/*padding: 0!important;*/
			padding-top: 50px; 
			z-index: 9999999;
		}
		.filterbar .category-wrapper {
		    overflow: scroll;
		}
		.category-wrapper {
			max-height: 480px!important;
		}
		.  .top-logo img{
      border-radius: 50%;
    }
    /*.weui-uploader__file {
        width: 40%;
        height: 79px;
    }*/
    .top-logo {
        width: 100%;
        height: 8em;
        margin-top: 1em;
        overflow: hidden;
    }
    .top-logo img {
        width: 6em;
        height: 6em;
        margin: 1em auto;
        display: block;
    }
    .weui-cell2:after {
        content: " ";
        position: absolute;
        left: 0;
        right: 0;
        height: 1px;
        color: #d9d9d9;
        bottom: 0;
        border-bottom: 1px solid #d9d9d9;
        -webkit-transform-origin: 0 100%;
        transform-origin: 0 100%;
        -webkit-transform: scaleY(.5);
        transform: scaleY(.5);
    }
    /*.weui-uploader__file {
          float: left;
          background: no-repeat 50%;
          background-size: cover;
          display: inline-block;
          margin: 0px 5%;
          background-size: 100% 100%;
      }*/
    .weui-cells {
	    margin-top: 0.2em;
	}
	.pic {
			width: 55px!important;
		}
		.pic img{
			width: 55px!important;
			height: 55px;
		}
		.filterbar .dropdown-wrapper {
		    position: absolute;
		    width: 100%;
		    z-index: inherit;
		}
		.filterbar .nav {
		    position: relative;
    		z-index: inherit;
		}
		.block {
			display: block;
		}
		.none {
			display: none;
		}
		.bottombar #send span {
		    background: #ff9433;
		}
		.main {
			width: 100%;
		    padding: 50px 0;
		}
		.content {
			padding: 5px .1rem;
		}
		.detail-top {
			width: 100%;
			height: 70px;
			background: #fff;
			border-radius: 3px;
		}
		.detail-top-left {
			width: auto;
			height: 100%;
			overflow: hidden;
			float: left;
		}
		.detail-top-left img{
			width: 55px;
			height: 55px;
			margin: 7.5px;
		}
		.detail-top-mid {
			width: 60%;
			height: 100%;
			overflow: hidden;
			float: left;
			margin-left: 5px;
		}
		.detail-title {
			width: 100%;
		    height: 40px;
		    line-height: 32px;
		    font-size: 14px;
		    padding-top: 5px;
		    overflow: hidden;
		    text-overflow: ellipsis;
		    white-space: nowrap;
		}
		.detail-type {
		    width: 46px;
		    height: 20px;
		    text-align: center;
		    line-height: 20px;
		    color: #fff;
		    background: #ff9433;
		    float: left;
		    font-size: 10px;
		    border-radius: 3px;
		}
		.detail-top-right {
			width: 15%;
			height: 100%;
			overflow: hidden;
			float: right;
		}
		.detail-money {
			width: auto;
		    height: 40px;
		    text-align: center;
		    font-size: 20px;
		    line-height: 50px;
		}
		.detail-mtype {
			text-align: center;
		}
		.detail-content{
			width: 100%;
			height: auto;
			overflow: hidden;
			background: #fff;
			margin-top: 5px;
		}
		.each-introduce {
			width: 100%;
			height: auto;
			background: #fff;
			overflow: hidden;
		}
		.introduce-left {
			width: auto;
			height: auto;
			overflow: hidden;
			float: left;
			text-align: center;
			line-height: 3em;
		}
		.introduce-right {
			width: 70%;
		    height: auto;
		    overflow: hidden;
		    float: left;
		    text-align: left;
		    line-height: 2em;
		    padding-top: 9px;
		}
		.introduce-new {
			background: #fff;
		    width: 94%;
		    height: auto;
		    overflow: hidden;
		    float: right;
		    text-align: left;
		    line-height: 1.5em;
		    padding: 0 2% 0 4%;
		    margin-bottom: 5px;
		}
    </style>
  </head>
  <body ontouchstart style="background: #fff">
    <div class="navbar">
        <div class="nav-wrap-left">
            <a class="nav-btn" href="javascript:history.go(-1);">
                <i style="font-size: 22px" class="iconfont icon-goback"></i>
            </a>
        </div>
		<div class="nav-title">任务详情</div>
		<div class="nav-wrap-right">

		</div>
    </div>
    <!-- 正文 -->
    <div class="main">
		<div class="weui-cells weui-cells_form">
    		<div class="weui-cell">
				<if condition="$qd_status eq 1">
				<div class="weui-cell__bd" id="qiandao">
					<button type="submit" class="weui-btn weui-btn_primary" onclick='qiandao(this,"{$id}" )' disabled  style="background:#ffd966">已签到</button>
				</div>
				<else />
				<div class="weui-cell__bd" id="qiandao">
                <!--
						<button type="submit" class="weui-btn weui-btn_primary" onclick='qiandao(this,"{$id}")' >签到</button>
                -->
                <button type="submit" class="weui-btn weui-btn_primary" onclick='get("{$id}",this)' >签到</button>
		         </div>
				</if>
			</div>
			<input type="hidden" id='a_id' value="{$id}">
		    <div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">进场验收:物料搭建+礼品清单(两张)</label></div>
			</div>
			<empty name="start_img">
				
					<div class="weui-uploader__bd" style="padding: 10px;width: 100%;box-sizing: border-box;">
						<ul class="weui-uploader__files" id="uploaderFiles1" >
						</ul>
						<div class="weui-uploader__input-box">
							<span id="uploaderInput1" class="weui-uploader__input" onclick="chooseImage(this,1)">
						</div>
					</div>
		
			<else />
				<div class="weui-uploader__bd" style="padding: 10px;width: 100%;box-sizing: border-box;">
					<ul class="weui-uploader__files" id="uploaderFiles1" >
						<foreach name="start_img" item="vo">
							<li class="weui-uploader__file" style="background-image:url('http://house.wechatpic.com/upload/weixin/{$vo}')"></li>
						</foreach>
					</ul>
					<div class="weui-uploader__input-box">
						<span id="uploaderInput1" class="weui-uploader__input" onclick="chooseImage(this,1)">
					</div>
				</div>
			</empty>


		</div>

	   </div>
    <if condition="$img_show eq 1">
	     	<div class="weui-cell">
		        <div class="weui-cell__hd"><label class="weui-label">撤场验收:物料收纳+礼品清单(两张)</label></div>
		    </div>
			<empty name="end_img">
				
					<div class="weui-uploader__bd" style="padding: 10px;">
						<ul class="weui-uploader__files" id="uploaderFiles2" >
						</ul>
						<div class="weui-uploader__input-box">
							<span id="uploaderInput2" class="weui-uploader__input" onclick="chooseImage(this,2)">
						</div>
					</div>
		
			<else />
				<div class="weui-uploader__bd" style="padding: 10px;">
					<ul class="weui-uploader__files" id="uploaderFiles2" >
						<foreach name="end_img" item="vo">
							<li class="weui-uploader__file" style="background-image:url(http://house.wechatpic.com/upload/weixin/{$vo})"></li>
						</foreach>
					</ul>
					<div class="weui-uploader__input-box">
						<span id="uploaderInput2" class="weui-uploader__input" onclick="chooseImage(this,2)">
					</div>
				</div>
			</empty>
        </if>
		<div class="weui-cells weui-cells_form">
	  		<!-- <div style="text-align: center;padding: 5px 0;background: #ffd966;color: #000;font-family: "黑体";">绩效数据</div> -->
	  		<div class="content">

	    		<div class="detail-content">
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					兼职日期：
	    				</div>
	    				<div id="jobDetail-time" class="introduce-right">
							<a class="list-item clearfix">{$active_info['create_time']|date='Y-m-d',###}</a>
	    				</div>
	    			</div>
                    <div class="each-introduce">
                        <div class="introduce-left">
                            项目名称：
                        </div>
                        <div id="jobDetail-time" class="introduce-right">
                            <a class="list-item clearfix">{$active_info.aname|get_aname}</a>
                        </div>
                    </div>
                    <div class="each-introduce">
                        <div class="introduce-left">
                            楼盘名称：
                        </div>
                        <div id="jobDetail-time" class="introduce-right">
                            <a class="list-item clearfix">{$loupan.name}</a>
                        </div>
                    </div>
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					督导：
	    				</div>
	    				<div id="jobDetail-num" class="introduce-right">
	    					<!-- 100人 -->
							<a class="list-item clearfix">{$dudao_info['truename']}:{$dudao_info['mobile']}</a>
	    				</div>
	    			</div>
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					搭档：
	    				</div>
	    				<div id=" " class="introduce-right">
							<foreach name="friend" item="vo">
							<a class="list-item clearfix">{$active_info.id|get_friend}</a>
							</foreach>
	    				</div>
	    			</div>
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					工作内容：
	    				</div>
	    				<div id="jobDetail-time" class="introduce-right">
							<a class="list-item clearfix">{$job_info['work_describe']}</a>
	    				</div>
	    			</div>
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					岗位要求：
	    				</div>
	    				<div id="jobDetail-date" class="introduce-right">
							<a class="list-item clearfix">{$job_info['job_require']}</a>
	    				</div>
	    			</div>
	    			<!-- <div class="each-introduce">
	    				<div class="introduce-left">
	    					场地：
	    				</div>
	    				<div id="jobDetail-time" class="introduce-right">
							<a class="list-item clearfix">{$job_info['work_city']}{$job_info['work_place']}</a>
	    				</div>
	    			</div>

	    			<div class="each-introduce">
	    				<div class="introduce-left">
							运输人员：
	    				</div>
	    				<div id="jobDetail-sex" class="introduce-right">
							<a class="list-item clearfix">{$driver_info['truename']}:{$driver_info['mobile']}</a>
	    				</div>
	    			</div> -->
	    			
<!--
	    			<div class="each-introduce">
	    				<div class="introduce-left">
	    					工作内容描述：
	    				</div>
	    				<div class="introduce-right">
	    					{$job_info.work_describe}
	    				</div>
	    			</div>
-->
	    		</div>
    		</div>
   		</div>
   	</div>
    <!--楼盘经纬度-->
    <input type='hidden' class='lng' value="{$loupan_info['lng']}">
    <input type='hidden' class='lat' value="{$loupan_info['lat']}">
    <input type='hidden' class='district' value="{$loupan_info['district']}">
	<div id="allmap1"></div>
    <script src="__STATIC__/mobile/js/jquery-2.1.4.js"></script>
    <!-- <script src="js/fastclick.js"></script> -->

    <script>

    		function check(id,obj){
		    $.ajax({
				url:"{:U('qian_dao')}",
				data:{id:id},
				dataType:"json",
				type:"POST",
				success:function(ret){
				    if(ret.ret==1){
				        alert("签到成功");
						$(obj).html('已签到');
						$(obj).addClass("weui-btn_disabled").attr('disabled','disabled')
					}
				}
			})	    			
    		}
    		function setCheck(position,data){
			switch(position){
				case "rightUP":
				  if( (data.manlat - data.lat) < 1 && (data.manlng - data.lng) < 1 ){
			  			check(data.id,data.obj);
			  	  }else{
			  	  		alert("未到达目标地点")
			  	  }				  
				  break;
				case 'rightBottom':
				  if( (data.manlat - data.Iat) < 1 && (data.manlng - data.lng) < -1 ){
			  			check(data.id,data.obj);
			  	  }else{
			  	  		alert("未到达目标地点")
			  	  }		
				  break;
				case 'leftBottom':
				  if( (data.manlat - data.Iat) < -1 && (data.manlng - data.lng) < -1 ){
			  			check(data.id,data.obj);
			  	  }else{
			  	  		alert("未到达目标地点")
			  	  }		
				  break;
				case 'leftUp':
				  if( (data.manlat - data.Iat) < -1 && (data.manlng - data.lng) < 1 ){
			  			check(data.id,data.obj);
			  	  }else{
			  	  		alert("未到达目标地点")
			  	  }		
				  break;
			}
    		}
    		function getPosition(lng,lat,manlng,manlat,id,obj){
    			var data = {
    				lng : lng,
    				lat : lat,
    				manlng : manlng,
    				manlat : manlat,
    				id : id,
    				obj : obj
    			}
    			if(manlat > lat && manlng > lng){
    				return setCheck("rightUP",data)
    			}
    			if(manlat > lat && manlng < lng){
    				return setCheck("rightBottom",data)
    			}
    			if(manlat < lat && manlng < lng){
    				return setCheck("leftBottom",data)
    			}
    			if(manlat < lat && manlng > lng){
    				return setCheck("leftUp",data)
    			}
    		}
		function qiandao(obj,id){

			wx.getLocation({
				type: 'gcj02', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
				success: function (res) {
				  // alert(JSON.stringify(res));
				  // alert($(".lng").val());
				  // alert(Number($(".lng").val()).toFixed(4));
				  // alert(Number($(".lat").val()).toFixed(4));
				  // alert(res)
				  // alert(res.latitude)
				  // alert(Number(res.longitude).toFixed(4));
				  var oldlng = Number($(".lng").val()).toFixed(4);
				  var oldlat = Number($(".lat").val()).toFixed(4);
				  var newlng = Number(res.longitude).toFixed(4);
				  var newlat = Number(res.latitude).toFixed(4);
		  		 					        getPosition(oldlng,oldlat,newlng,newlat,id,obj)	
					var url ="http://api.map.baidu.com/geoconv/v1/?coords="+res.longitude+","+res.latitude+"&from=1&to=5&ak=txS8rG2Nfj9BvYVqDdevjj6MBj2wY8hE";
					$.ajax({
					    url: url,
					    dataType: 'json',
					    success: function(data,status,xhr) {
					        console.log(data.result);
					        getPosition(oldlng,oldlat,newlng,newlat,id,obj)		
					    }

					});

				},
				cancel: function (res) {
				  alert('用户拒绝授权获取地理位置');
				}
			});

		}
		
		$(function() {
			console.log(window.localStorage.mid);
			checkLogin();
			var url1 = window.location.href;
			console.log(url1);

            wx.config({
                debug: false,
                appId: '{$sign.appId}',
                timestamp: '{$sign.timestamp}',
                nonceStr:'{$sign.nonceStr}',
                signature:'{$sign.signature}',
                jsApiList: [
                    'chooseImage','uploadImage','getLocation'
                ]
            });

		});
    </script>
    <script src="__STATIC__/mobile/js/jquery-weui.js"></script>
    <script src="__STATIC__/mobile/js/city-picker.js"></script>
    <script src="__STATIC__/mobile/js/globalvariable.js"></script>
    <script src="__STATIC__/mobile/js/sose.js"></script>
    <script>
        // $("#showTooltips").click(function() {
          
        // })
        // 下拉刷新
        // $('#joblist').pullToRefresh();
      //   $('.main').pullToRefresh().on("pull-to-refresh", function() {
	     //    setTimeout(function() {
	     //    	alert("下拉刷新");
	     //    	$('.main').pullToRefreshDone();
	     //    }, 1000);
	     // });
        // 上拉加载
        // $('#joblist').infinite();
        var loading = false;
        var areaName = '';
		var cityName = '';
		var pageNo = 1;
		var pageSize = 10;
		var flag ='asc';
		var jobType = 0;
		var workType = 0;
		var tid;
		var jobTypeName;
       	var city = window.localStorage.city;
       	var latitude;
       	var longitude;
       	var first = true;
		
       

        function checkLogin() {
        	// alert(window.localStorage.mid);
        	if (isNull(window.localStorage.mid)) {
        		$('.loginType').attr("data-type",2);
	            $('.loginType').removeClass("icon-tuichudenglu").addClass("icon-iconfontwodea-copy-copy");
        	} else {
        		var obj = {
	        		'mId':window.localStorage.mid,
	        	};
	        	doPost("account/info.web", obj, function(data) {
	        		// JSON.stringify(data)
	        		// alert(JSON.stringify(data));
		            if (data.success) {
		            	// alert(1);
		            	$('.loginType').attr("data-type",1);
		            	$('.loginType').addClass("icon-tuichudenglu").removeClass("icon-iconfontwodea-copy-copy");
		            } else {
		            	// alert(2);
		            	$('.loginType').attr("data-type",2);
		            	$('.loginType').removeClass("icon-tuichudenglu").addClass("icon-iconfontwodea-copy-copy");
		                $.toast(data.errMsg,"text");
		            }
		        }, function(data) {
		              $.toast(data.errMsg,"text");
		        });
        	}
        	
        }
	function chooseImage(obj,type){
		if(type == 1){
			//判断是否签到
			$.post("{:U('My/check_qiandao')}",{a_id:$('#a_id').val()},function(res){
				if(res == 2){
					alert('签到后才能开始活动哦!');return false;
				}else{
					// 选择张片
					wx.chooseImage({
						count: 1, // 默认9
						sizeType: [ 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
						sourceType: ['album','camera'], // 可以指定来源是相册还是相机，默认二者都有
						success: function(res) {
							var localIds = res.localIds;
							//alert(localIds)
							// 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
							$(obj).attr('src', localIds);
							var str = '';
							localIds.forEach(function(i){
								var html = `<li class="weui-uploader__file" style="background-image:url(${i})"></li>`
								str += html
							})
							$(obj).parent().prev().html(str);
							// 上传照片
							uploadImg(localIds,type)
						}
					});
				}
			})
		}else{
			// 选择张片
			wx.chooseImage({
				count: 1, // 默认9
				sizeType: [ 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
				sourceType: ['album','camera'], // 可以指定来源是相册还是相机，默认二者都有
				success: function(res) {
					var localIds = res.localIds;
					//alert(localIds)
					// 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
					$(obj).attr('src', localIds);
					var str = '';
					localIds.forEach(function(i){
						var html = `<li class="weui-uploader__file" style="background-image:url(${i})"></li>`
						str += html
					})
					$(obj).parent().prev().html(str);
					// 上传照片
					uploadImg(localIds,type)
				}
			});
		}

		
		
	}

      function uploadImg(localIds,type){
		var localId = localIds.pop();
		wx.uploadImage({
			localId: localId,
			isShowProgressTips: 1,
			success: function(res) {
				serverId =res.serverId;
				$.ajax({
					url:"{:U('My/get_img')}",
					type:"POST",
					dataType:"json",
					data:{img_id:serverId,id:"<?php echo $_GET['id'];?>",type:type},
					success:function(ret){
						//返回图片在服务器地址ret.save_path
						var imgSrc = ret.save_path
						// console.log(ret);
						if(ret.ret==1){
							alert("上传成功");
							if(ret.cc == 1){
								//撤场弹框提示
								$.alert({
								  title: '提示',
								  text: '恭喜您本日任务已完成!',
								  onOK: function () {
								    //点击确认
								    wx.closeWindow();
								  }
								});
							}else{
								// console.log("上传成功");
								window.location.href=window.location.href+"?id="+10000*Math.random();
							}
							
						}
					      if(localIds.length > 0){
					      	uploadImg(localIds,type);
					      }
					},
					error : function(x,y,z){
						console.log(x);
						console.log(y);
						console.log(z);
					}
				})
			}
		});      		


      }


        $(window).scroll(function(){                
	        var scrollh = $(document).height();  
	        var bheight =  $(window).height();
	        console.log("scrollh:"+scrollh+",bheight:"+bheight);
	        var scrollTop=Math.max(document.documentElement.scrollTop||document.body.scrollTop);  
	        if((scrollTop + $(window).height()) >= scrollh){  
	            // alert("jiazai");
	        }  
	    }); 
    </script>
  </body>
</html>
<script>
    function get(id,obj){
        var district = $('.district').val();
        var lng = $('.lng').val();//楼盘经度
        var lat = $('.lat').val();//楼盘纬度
        var ac_time = "{$ac_time}";
        wx.getLocation({
            type: 'gcj02', // 默认为wgs84的gps坐标，如果要返回直接给openLocation用的火星坐标，可传入'gcj02'
            success: function (res) {
                //console.log(res);
                var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
                var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
                var speed = res.speed; // 速度，以米/每秒计
                var accuracy = res.accuracy; // 位置精度
                //alert(latitude);
                //alert(longitude);
                $.post("{:U('get_jw')}",{latitude:latitude,longitude:longitude,district:district,lng:lng,lat:lat,ac_time:ac_time},function(re){
                    //alert('wx:'+re.wx);alert('pc:'+re.pc);
                    //console.log(re);
                        if(re.msg == 1){
                            // alert('距离目的地还有'+re.metre+'km');
                            check(id,obj);
                        }else if(re.msg == 3){
                        	alert('不在活动时间范围内哦!');
                        }else{
                            alert('未达到目的地哦!距离目的地还有'+re.metre+'km');
                            
                        }
                })
                
            }
        });
        
    }
</script>